/*
*   Grupo 2:		Ana Elisa Siena			7126563
*                       Larissa Zimmermann		7126879
* 
*   Jogo em Java - AngryBirds
*   SCC - 604 - Programação Orientada a Objetos
*   Prof. Fernando V. Paulovich
*   Engenharia de Computação 010 - USP - São Carlos
*   Segundo Semestre de 2011 
*	
*/

package angrybirds.personagens;

import org.newdawn.slick.Animation;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SpriteSheet;
import org.newdawn.slick.geom.Vector2f;
import org.newdawn.slick.state.StateBasedGame;

public class Personagem implements InterfacePersonagem{
           
        private String name;
        private Animation anime;
        private SpriteSheet image;
//        private SpriteSheet anime;
        private Vector2f position;
        
        public Personagem(String name, Animation anime, SpriteSheet image, Vector2f position){
//            System.out.println("X'':"+this.position.x+"Y'':"+this.position.y);
            this.name = name;
            this.anime = anime;
            this.image = image;
            this.position = position;
	}
 
	@Override
	public String getName() {
		return name;
	}
 
	@Override
	public Vector2f getPosition() {
		return position;
	}
 
	@Override
	public void setPosition(Vector2f position) {
		this.position = position;
	}
 
	public Animation getAnime(){
		return this.anime;
	}
        
        public void renderizar(){
            this.anime.addFrame(this.image.getSprite(0, 0), 300);
            this.anime.addFrame(this.image.getSprite(1, 0), 300);
            this.anime.addFrame(this.image.getSprite(2, 0), 300);
        }
 
    @Override
	public void render(Graphics graphics) {
           graphics.drawAnimation(this.anime, this.getPosition().x, this.getPosition().y); 
	}
 
 
	@Override
	public void update(GameContainer gc, StateBasedGame sbg, int delta) {
	}    
}
